import { defineStore } from 'pinia'

export const useMenuStore = defineStore('menu', {
  state: () => ({
    // 菜单列表
    menuList: [],
    // 菜单是否折叠
    isCollapsed: false,
    // 专家菜单
    expertMenu: [
      {
        title: '首页',
        path: '/expert',
        icon: 'mdi-home'
      },
    ],
    // 投标人菜单
    bidderMenu: [
      {
        title: '首页',
        path: '/bidder',
        icon: 'mdi-home'
      },
    ],
    // 管理员菜单
    adminMenu: [
      {
        title: '统计报表',
        path: '/admin/dashboard',
        icon: 'mdi-chart-line'
      },
      {
        title: '询标报表',
        path: '/admin/inquiries',
        icon: 'mdi-file-document'
      }
    ]
  }),

  getters: {
    getExpertMenu: (state) => state.expertMenu,
    getBidderMenu: (state) => state.bidderMenu,
    getAdminMenu: (state) => state.adminMenu
  },

  actions: {
    setMenuList(menu) {
      this.menuList = menu
    },
    toggleCollapse() {
      this.isCollapsed = !this.isCollapsed
    }
  }
})